Allow disabling truncation
authorjustbur <justin@burkett.cc>
Wed, 2 Sep 2015 16:51:47 +0000 (12:51 -0400)
committerjustbur <justin@burkett.cc>
Wed, 2 Sep 2015 16:51:47 +0000 (12:51 -0400)
which-key.el

index 37d8bb6a9aa7306d2ef19d1377bd20fea93fdf7f..e57a63f1f3d0c8b0800c4ad594a4804f52f1db04 100644 (file)
@@ -63,7 +63,7 @@ which-key popup."
 
 (defcustom which-key-max-description-length 27
   "Truncate the description of keys to this length.
-Also adds \"..\"."
+Also adds \"..\". If nil, disable any truncation."
   :group 'which-key
   :type 'integer)
 
@@ -829,7 +829,8 @@ If KEY contains any \"special keys\" defined in
 
 (defsubst which-key--truncate-description (desc)
   "Truncate DESC description to `which-key-max-description-length'."
-  (if (> (string-width desc) which-key-max-description-length)
+  (if (and which-key-max-description-length
+           (> (string-width desc) which-key-max-description-length))
       (concat (substring desc 0 which-key-max-description-length) "..")
     desc))